package com.atguigu.gmall.web.controller;

import com.atguigu.gmall.order.client.OrderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;

/**
 * @Author: lx
 * @Time: 15:15
 * @Description:
 *
 * 结算
 */
@Controller
public class TradeController {

    //远程调用 订单微服务
    @Autowired
    private OrderFeignClient orderFeignClient;

    //去结算页面
    @GetMapping("/trade.html")
    public String trade(Model model){
        Map<String, Object> map = orderFeignClient.trade();
        model.addAllAttributes(map);
        return "order/trade";
    }
}
